package main

import (
	"fmt"
	"sync"
)

func main() {
	var wg sync.WaitGroup
	wg.Add(5)
	for i := 1; i <= 5; i++ {
		go func() {
			fmt.Printf("第%d次执行\n", i)
			wg.Done()
		}()
	}

	wg.Wait()
	fmt.Println("执行结束")
}
